﻿using Npoi.Mapper.Attributes;
using RTools_NTS.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TulingMember.Core;

namespace TulingMember.Application.Dto
{
    public class SaleOrderDto
    {
        public List<cts_PrintTag> printtag { get; set; }
        public string companyname { get; set; }
        public cts_SaleOrder order { get; set; }
        public List<cts_SaleOrderDetail> detail { get; set; }
        /// <summary>
        /// 状态0.待审核1.已审核,2暂存,3退回
        /// </summary>
        public int status { get; set; }
        public string displayName { get; set; }

        public string medicalCardNo { get; set; }

        public int CustomerAge { get; set; }
        public string createName { get; set; }
        public string reviewerName { get; set; }
    }

    public class SaleOrderBackDto
    {
        public List<cts_PrintTag> printtag { get; set; }
        public string companyname { get; set; }
        public cts_SaleOrderBack order { get; set; }
        public List<cts_SaleOrderDetailBack> detail { get; set; }
    }


    /// <summary>
    /// 处方单导出
    /// </summary>
    public class SaleOrderExport
    {
        [Column("单据日期")]
        public DateTime? OrderDate { get; set; }
        [Column("单据编号")]
        public string OrderNo { get; set; }
        [Column("姓名")]
        public string CustomerName { get; set; }
        [Column("性别")]
        public string Sex { get; set; }
        [Column("年龄")]
        public int Age { get; set; }
        //[Column("生日")]
        //public DateTime Birthday { get; set; }
        [Column("部门")]
        public string DepartmentName { get; set; }
        [Column("症状")]
        public string Symptom { get; set; }
        [Column("药品")]
        public string OrderDesc { get; set; }
        [Column("合计(元)")]
        public decimal Amount { get; set; }
        //[Column("打印次数")]
        //public int PrintNum { get; set; }
        [Column("临床诊断")]
        public string Remark { get; set; }

        //public int GetAge()
        //{
        //    DateTime now = DateTime.Today;

        //    int age = now.Year - Birthday.Year;

        //    if (Birthday.Date > now.AddYears(-age)) age--;

        //    return age;
        //}

    }

    /// <summary>
    /// 明细导出
    /// </summary>
    public class SaleOrderDetailExport
    {
        [Column("药品名称")]
        public string ProductName { get; set; }
        [Column("生产厂家")]
        public string Manufacturer { get; set; }
        [Column("生产日期")]
        public DateTime ManufacturingDate { get; set; }
        [Column("有效期至")]
        public DateTime ExpirationDate { get; set; }
        [Column("单价")]
        public decimal Price { get; set; }
        [Column("数量")]
        public int Num { get; set; }
        [Column("处方明细创建时间")]
        public DateTimeOffset? CreatedTime { get; set; }
    }
}
